import request from '@/utils/request'

// 查询供方列表
export function listSupplier(query) {
  return request({
    url: '/po/supplier/list',
    method: 'get',
    params: query
  })
}

// 查询料品大类
export function materialSort() {
  return request({
    url: '/wm/warehouses/getSort',
    method: 'get',
    })
}

// 导出供应商
export function exportSupplier(query) {
  return request({
    url: '/po/supplier/export',
    method: 'get',
    params: query
  })
}

// 新增供应商
export function addSupplier(data) {
  return request({
    url: '/po/supplier',
    method: 'post',
    data: data
  })
}

// 修改供应商
export function updateSupplier(data) {
  return request({
    url: '/po/supplier',
    method: 'put',
    data: data
  })
}

// 删除供应商
export function delSupplier(name) {
  return request({
    url: '/po/supplier/' + name,
    method: 'delete'
  })
}

// 字典
export function dictMatching (query) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}

// 清空
export function emptyFile() {
  return request({
    url: '/po/supplier/dump',
    method: 'get',
  })
}
